import { createApp } from 'vue'
import App from '@/App.vue'
//引入element-plus
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
//@ts-ignore 忽略当前文件ts类型的检测否则有红色提示(打包会失败)
import zhCn from 'element-plus/es/locale/lang/zh-cn'
//引入路由
import router from './router'
//引入仓库
import pinia from './store'
//引入路由鉴权
import './permission'
//svg插件配置
import 'virtual:svg-icons-register'

//引入模板的全局样式
import '@/styles/index.scss'
//引入自定义插件对象:注册整个项目全局组件
import gloalComponent from '@/components'
//暗黑模式
import 'element-plus/theme-chalk/dark/css-vars.css'
const app = createApp(App)
//引入自定义指令
import { hasBtn } from '@/directive/btn.ts'
hasBtn(app)
//安装element-plus插件
app.use(ElementPlus, {
  locale: zhCn, //国际化配置
})
//注册路由
app.use(router)
//注册仓库
app.use(pinia)
//安装自定义插件
app.use(gloalComponent)

app.mount('#app')

console.log('环境变量：', import.meta.env)
